Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Новые команды setallbalance и setbalance #257

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

user424242420
Copy link

@user424242420 user424242420 commented Jun 3, 2024

setallbalance и setbalance команды по заказу кмина

ДЛЯ РАБОТЫ КОМАНД НАДО ПЕРЕЗАГРУЗИТЬ СЕРВЕР ТАК КАК ОНИ МЕНЯЮТ ДАННЫЕ В БАЗЕ ДАННЫХ.

То есть можно засетать 0 даже тому кто сейчас не на сервере

Copy link
Member

@FireNameFN FireNameFN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Про ранний выход и не слышал.

@user424242420 user424242420 requested a review from FireNameFN June 4, 2024 13:05
{
var loc = IoCManager.Resolve<ILocalizationManager>();
var set_balance = 0;
int.TryParse(args[1], out set_balance);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вот этот мусор сделает всем плохо.

Comment on lines +267 to +269
await using var db = await GetDb();
await db.DbContext.Database.ExecuteSqlAsync($"""UPDATE profile SET bank_balance = {set_balance}""");
await db.DbContext.SaveChangesAsync();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SQL инъекции привет передают

Copy link
Collaborator

@JerryImMouse JerryImMouse Jun 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var parameters = new[]
{
        new SqlParameter("@balance", setBalance),
};
await db.DbContext.Database.ExecuteSqlRawAsync(query, parameters);

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JerryImMouse а ты видишь какие параметры передаются в функцию? Как ты строку в инт передашь?

@Vonsant
Copy link
Collaborator

Vonsant commented Jun 15, 2024

Пусть висит в открытых, это на новый год.

@Vonsant Vonsant closed this Jul 13, 2024
@Vonsant Vonsant reopened this Jul 13, 2024
@Vonsant Vonsant closed this Jul 13, 2024
@Vonsant Vonsant reopened this Jul 13, 2024
@user424242420
Copy link
Author

🙃

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants